//
//  encourageVC.m
//  EquiriesProject
//
//  Created by qianfeng on 15/10/31.
//  Copyright (c) 2015年 HXH. All rights reserved.
//

#import "encourageVC.h"
#import "encourageBaidu.h"

@interface encourageVC ()

@end

@implementation encourageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1];
    
    [self createNav];
    [self creaetButton];
}

-(void)createNav
{
    UILabel * label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 120, 40)];
    label.text = @"鼓励一下";
    label.textAlignment = NSTextAlignmentCenter;
    label.textColor = [UIColor whiteColor];
    label.font = [UIFont systemFontOfSize:22];
    [self.view addSubview:label];
    self.navigationItem.titleView = label;
}

-(void)creaetButton
{
    UIButton * button = [[UIButton alloc]init];
    [button setTitle:@"点击进去,鼓励一下自己吧😊" forState:UIControlStateNormal];
    button.backgroundColor = [UIColor grayColor];
    button.layer.cornerRadius = 10;
    button.layer.masksToBounds = YES;
    [self.view addSubview:button];
    [button addTarget:self action:@selector(buttonClick) forControlEvents:UIControlEventTouchUpInside];
    [button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(40);
        make.right.equalTo(self.view.mas_right).offset(-40);
        make.top.equalTo(self.view.mas_top).offset(200);
    }];
}

-(void)buttonClick
{
    encourageBaidu * encourage = [[encourageBaidu alloc]init];
    encourage.isHindder = YES;
    [self.navigationController pushViewController:encourage animated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
